package com.example.javafx.按钮;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

/**
 * 按钮样式
 */
public class Main_2 extends Application {
    @Override
    public void start(Stage primaryStage) throws Exception {
        Scene scene = new Scene( new Group());
        primaryStage.setWidth(300);
        primaryStage.setHeight(190);

        VBox vBox = new VBox();
        vBox.setLayoutX(20);
        vBox.setLayoutY(20);
        Button button1 = new Button("Accept");
        button1.setStyle("-fx-font: 30 arial; -fx-base:#ee2211;");

        vBox.getChildren().add(button1);
        vBox.setSpacing(10);
        ((Group)scene.getRoot()).getChildren().add(vBox);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
